package tjs.study.notes.queue.producer.kafka.myStream;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.integration.support.MessageBuilder;
import tjs.study.notes.queue.producer.base.MsgBase;

//自定义通道
@EnableBinding(MySource.class)
public class MySendService {

    @Autowired
    private MySource source;

    public void sendMsg(String msg){
        MsgBase msgBase = new MsgBase(msg);
        source.myOutput().send(MessageBuilder.withPayload(msgBase)
                .setHeader("type","testHeader").build());
    }
}